package com.iv.durian.cloud.dao;

import com.iv.durian.cloud.LessonContent;
import com.iv.durian.cloud.LessonTimeLine;
import com.iv.durian.cloud.dao.mapper.LessonDetailMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

/**
 * Created by lenovo on 2018-07-01.
 */
@Repository
public class LessonDetailDao {

    @Autowired
    private LessonDetailMapper lessonDetailMapper;

    public LessonContent getLessonContent(Integer lessonId){
        return lessonDetailMapper.getLessonContent(lessonId);
    }

    public LessonTimeLine getLessonTimeLine(Integer lessonId){
        return lessonDetailMapper.getLessonTimeLine(lessonId);
    }

    public int addLessonContent(LessonContent lessonContent){
        return lessonDetailMapper.addLessonContent(lessonContent);
    }

    public int addLessonTimeLine(LessonTimeLine lessonTimeLine){
        return lessonDetailMapper.addLessonTimeLine(lessonTimeLine);
    }

    public int updateLessonContent(LessonContent lessonContent){
        return lessonDetailMapper.updateLessonContent(lessonContent);
    }

    public int updateLessonTimeLine(LessonTimeLine lessonTimeLine){
        return lessonDetailMapper.updateLessonTimeLine(lessonTimeLine);
    }

//    public List<LessonDetail> list(@Param("lessonId") Integer lessonId,@Param("status") Integer status, @Param("offset") Integer offset, @Param("limit") Integer limit);

    public int countLessonContent(Integer lessonId){
        return lessonDetailMapper.countLessonContent(lessonId);
    }

    public int countLessonTimeLine(Integer lessonId){
        return lessonDetailMapper.countLessonTimeLine(lessonId);
    }

    public int deleteLessonContent(Integer lessonId){
        return lessonDetailMapper.deleteLessonContent(lessonId);
    }

    public int deleteLessonTimeLine(Integer lessonId, Integer id){
        return lessonDetailMapper.deleteLessonTimeLine(lessonId, id);
    }


}
